package com.cmfi.dao;

import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import com.cmfi.domain.ProductionRts;

// TODO 添加@Mapper
@Mapper
public interface ProductionRtsDao {
    
    @Select("SELECT fpi.position,fpi.vinCode,fp.planId,fp.bomCode,fpi.updateTime "
    		+ "FROM forklift_part_info fpi "
    		+ "JOIN forklift_plan fp ON fpi.vinCode = fp.vinCode "
    		+ "WHERE fpi.position IN (SELECT position "
    		                          + "FROM forklift_part_info "
    		                          + "GROUP BY position "
    		                          + "ORDER BY MAX(updateTime) DESC) "
    		+ "ORDER BY fpi.position, fpi.updateTime DESC")
	List<ProductionRts> findAllPositionStatus();
}
